How do you add, get, update, and delete records?
103
02-Jul-2025
Manish Sharma
02-Jul-2025We'll assume a database
UserDBwith an object store namedusersandkeyPath: "id".Setup (once)
Add a Record
Example usage:
Get a Record by Key
Usage:
Update a Record
You use
put()instead ofadd()— it replaces the object with the same key:Example:
Delete a Record
Example:
Optional: Get All Records
Summary of Methods
store.add(data)store.get(key)store.put(data)store.delete(key)store.getAll()